package com.wangjie.tests;

import org.junit.*;

import static org.junit.Assert.assertEquals;

public class Demo {

    @BeforeClass
    public static void beforeClassTest(){
        System.out.println("单元测试开始之前执行初始化");
        System.out.println("-----------------------------");
    }

    @Before
    public void beforeTest(){
        System.out.println("单元测试方法开始之前执行");
        System.out.println("-----------------------------");
    }

    @Test
    public void test1(){
       /* int a = 19;
        int b = 10;
        assertEquals("a-b=",8,a-b);*/
        Student stu = new Student(12,"wangjie");
        Student stu2 = new Student(12,"wangjie");
        //Assert.assertSame("stu==stu2",stu,stu2);
        //Assert.assertTrue("stu==stu2",stu.getAge()==stu2.getAge());
        Assert.assertNull(stu);
    }

    @After
    public void afterTest(){
        System.out.println("单元测试方法结束之后执行");
        System.out.println("-----------------------------");
    }

    @AfterClass
    public static void afterClassTest(){
        System.out.println("单元测试结束之后执行");
        System.out.println("-----------------------------");
    }
}
